@import '~/common/style/index.scss';

$checkbox-prefix-cls: #{$cui-prefix}-checkbox;

.#{$checkbox-prefix-cls}-wrapper {
  display: inline-flex;
  cursor: pointer;
  align-items: baseline;
}

.#{$checkbox-prefix-cls} {
  position: relative;
  // top: 0.1em;

  &+span {
    padding-right: 8px;
    padding-left: 8px;
  }

  input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;

    &:focus~.#{$checkbox-prefix-cls}--mark {
      box-shadow: 0px 0px 0px 3px $gray-9;
      border: 1px solid $blue-6;
    }

    &:checked:focus~.#{$checkbox-prefix-cls}--mark {
      box-shadow: 0px 0px 0px 3px $blue-9;
    }

    &:checked~.#{$checkbox-prefix-cls}--mark {
      background-color: $blue-5;

      border: 1px solid $blue-5;

      &.disabled {
        background-color: $gray-9;
        border: 1px solid $gray-9;
      }
    }

    &:checked~.#{$checkbox-prefix-cls}--mark::after {
      display: block;
    }

  }
  
  .#{$checkbox-prefix-cls}--mark {
    display: block;
    box-sizing: border-box;
    position: relative;
    height: 14px;
    width: 14px;
    border-radius: 2px;
    background-color: inherit;
    border: 1px solid $gray-3;

    &.disabled {
      border: 1px solid $gray-9;
    }

    &::after {
      content: "";
      position: absolute;
      display: none;
      left: 4px;
      width: 4px;
      height: 8px;
      border: solid $white;
      border-width: 0 1.5px 1.5px 0;
      transform: rotate(45deg);
    }
  }

}

.#{$checkbox-prefix-cls}-round{
  &>.#{$checkbox-prefix-cls}--mark{
    border-radius: 7px;
  }
}